<!DOCTYPE html>
<html>
<head>
    <title>活动产品抢购</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="产品编号"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("activitysnapup:info"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;查看</i-button>
                #end
                #if($shiro.hasPermission("activitysnapup:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("activitysnapup:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("activitysnapup:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="activitySnapUp" :rules="ruleValidate" :label-width="80">
            <Form-item label="产品编号" prop="pid">
                <i-input v-model="activitySnapUp.pid" placeholder="产品编号"/>
            </Form-item>
            <Form-item label="产品名称" prop="name">
                <i-input v-model="activitySnapUp.name" placeholder="产品名称"/>
            </Form-item>
            <Row>
                <i-col span="7">
                    <Form-item label="价格" prop="price">
                        <i-input v-model="activitySnapUp.price" placeholder="价格"/>
                    </Form-item>
                </i-col>
                <i-col span="7">
                    <Form-item label="spc价格" prop="spcPrice">
                        <i-input v-model="activitySnapUp.spcPrice" placeholder="spc价格"/>
                    </Form-item>
                </i-col>
            </Row>

            <Form-item label="原价格" prop="oldPrice">
                <i-input v-model="activitySnapUp.oldPrice" placeholder="原价格"/>
            </Form-item>
            <Form-item label="状态" prop="status">
                <Radio-group v-model="activitySnapUp.status" placeholder="状态">
                    <Radio label="0">
                        <span>关闭</span>
                    </Radio>
                    <Radio label="1">
                        <span>开启</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="数量" prop="number">
                <i-input v-model="activitySnapUp.number" placeholder="数量"/>
            </Form-item>

            <Form-item label="销售数量" prop="sales">
                <i-input v-model="activitySnapUp.sales" placeholder="销售数量"/>
            </Form-item>

            <!--<Form-item label="类型" prop="type">-->
            <!--<i-input v-model="activitySnapUp.type" placeholder="类型"/>-->
            <!--</Form-item>-->
            <Row>
                <i-col span="7">
                    <Form-item label="开始时间" prop="beginTime">
                        <Date-picker v-model="activitySnapUp.beginTime" type="datetime" format="yyyy-MM-dd HH:mm:ss"
                                     placeholder="开始时间"></Date-picker>
                    </Form-item>
                </i-col>
                <i-col span="7">
                    <Form-item label="结束时间" prop="endTime">
                        <Date-picker v-model="activitySnapUp.endTime" type="datetime" format="yyyy-MM-dd HH:mm:ss"
                                     placeholder="结束时间"></Date-picker>
                    </Form-item>
                </i-col>
            </Row>
            <!--<Form-item label="创建时间" prop="createDate">-->
            <!--<i-input v-model="activitySnapUp.createDate" placeholder=""/>-->
            <!--</Form-item>-->
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/active/activitysnapup.js?_${date.systemTime}"></script>
</body>
</html>